<template>
  <el-drawer
      v-model="isVisible"
      :size="'40%'"
      :with-header="true"
      :show-close="true"
  >
    <template #title>
      <div style="color: #f58147;font-size: 20px">评价详情</div>
    </template>
    <el-card style="box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); border-radius: 8px; margin: 10px 20px;">
      <el-form label-position="right" label-width="100px" style="padding: 20px;">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="评价编号">
              <el-input v-model="pingjia.pjid" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="用户编号">
              <el-input v-model="pingjia.yhid" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="订单编号">
              <el-input v-model="pingjia.ddid" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="商家编号">
              <el-input v-model="pingjia.sjid" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="商家评分">
              <el-input v-model="pingjia.sjpf" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="评价内容">
              <el-input v-model="pingjia.pjnr" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="商家回复">
              <el-input v-model="pingjia.sjhf" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="评论图片">
              <el-input v-model="pingjia.sctp" disabled />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-card>
  </el-drawer>
</template>


<script setup lang="ts">
import {ref} from "vue";

const pingjia = ref({
  pjid:'',
  yhid:'',
  ddid:'',
  sjid:'',
  sjpf:'',
  pjnr:'',
  sctp:'',
  sjhf:'',
});
//----------回显----------------
const isVisible = ref(false);
function handleDetailData(obj){
  pingjia.value = obj;
  isVisible.value = true;
}

//----------暴露方法----------------
defineExpose ({
  handleDetailData
})

</script>

<style scoped>
:deep(.el-drawer__header) {
  background-color: #f58147;
  color: #fff;
  margin-bottom: 10px;
  padding: 15px 20px;
  border-radius: 4px 4px 0 0;
}

:deep(.el-drawer__body) {
  padding: 0;
}

.el-form-item__content {
  width: 100%;
}

.el-input__inner {
  border-radius: 6px;
  border: 1px solid #e4e7ed;
  padding: 10px;
  background-color: #fff;
  transition: all 0.3s ease;
}

.el-input__inner:focus {
  border-color: #f58147;
  box-shadow: 0 0 5px rgba(245, 129, 71, 0.3);
}

.el-drawer {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  overflow: hidden;
}
</style>
